package com.example.langchain.ai;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import dev.langchain4j.rag.content.retriever.ContentRetriever;
import dev.langchain4j.service.*;
import dev.langchain4j.service.guardrail.InputGuardrails;
import dev.langchain4j.service.spring.AiService;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import reactor.core.publisher.Flux;

import java.time.LocalDateTime;
import java.util.List;
/**
 * @author Vin_Ken
 */ //@AiService
//@InputGuardrails({SafeInputGuardrail.class})
public interface AiCodeHelperService {
    @Data
    @Builder
    public static class Report {
        private String title;
        private String userInfo;
        private String assessment;
        private List<String> strengths;
        private List<String> weaknesses;
        private LearningPlan learningPlan;
        private List<String> resources;
        private List<String> expectedOutcomes;

        private LocalDateTime generateTime;
    }

    /**
     * 学习计划实体类
     */
    @Data
    @AllArgsConstructor
    public static class LearningPlan {
        private String month1;
        private String month2;
        private String month3;
    }
    @SystemMessage(fromResource = "system-prompt.txt")
    String chat(String userMessage);

    @SystemMessage(fromResource = "system-prompt-report.txt")
    String chatForReport(String userMessage);

//    String chatWithRAG(String userMessage);
    @SystemMessage(fromResource = "system-prompt.txt")
    Result<String> chatWithRag(String userMessage);
//    record Record(String name, List<String> suggestionList){}

//
//    String chatWithTools(String userMessage);

//    String chatWithMcp(String userMessage);
// 流式对话
Flux<String> chatStream(@MemoryId int memoryId, @UserMessage String userMessage);
}
